import React, { Component } from "react";
import { Route } from "react-router-dom";

export default class RouterView extends Component {
    render() {
        return this.props.routes.map((item, index) => {
            return (
                <Route
                    key={index}
                    path={item.path}
                    render={(props) => {
                        // 判断是否登录
                        return (
                            <item.component routes={item.children} {...props} />
                        );
                    }}
                />
            );
        });
    }
}
